class Solution {
public:
    int massage(vector<int>& nums) {
        int m = nums.size();
        if (m == 0) return 0;
        vector<int> f(m);
        vector<int> g(m);
        f[0] = nums[0];
        g[0] = 0;
        for (int i = 1; i < m; i++)
        {
            f[i] = g[i - 1] + nums[i];
            g[i] = max(f[i - 1], g[i - 1]);
        }

        return max(f[m - 1], g[m - 1]);
    }
};